<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html lang="en">
  <head>
    <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
      <title>新增车辆</title>
      
      <!-- Favicon -->
      <link rel="shortcut icon" href="/boot/llr/images/favicon.ico" />
      <link rel="stylesheet" href="/boot/llr/css/backend-plugin.min.css">
      <link rel="stylesheet" href="/boot/llr/css/backend.css?v=1.0.0">
      <link rel="stylesheet" href="/boot/llr/vendor/@fortawesome/fontawesome-free/css/all.min.css">
      <link rel="stylesheet" href="/boot/llr/vendor/line-awesome/dist/line-awesome/css/line-awesome.min.css">
      <link rel="stylesheet" href="/boot/llr/vendor/remixicon/fonts/remixicon.css">
      <link rel="stylesheet" href="/boot/llr/layui-v2.6.5/layui/css/layui.css">
  </head>
  <body>

    <!-- loader Start -->
    <div id="loading">
          <div id="loading-center">
          </div>
    </div>
    <div class="wrapper">
      
      <div class="iq-sidebar  sidebar-default ">
          <div class="iq-sidebar-logo d-flex align-items-center justify-content-between">
              <a href="index.jsp" class="header-logo">
                  <img src="/boot/llr/images/logo.png" class="img-fluid rounded-normal light-logo" alt="logo"><h5 class="logo-title light-logo ml-3">POSDash</h5>
              </a>
              <div class="iq-menu-bt-sidebar ml-0">
                  <i class="las la-bars wrapper-menu"></i>
              </div>
          </div>

<%--          导入左侧菜单栏--%>
          <%@ include file="/WEB-INF/jsp/Common/leftMenu.jsp"%>


          </div>
        <div class="iq-top-navbar">
          <div class="iq-navbar-custom">
              <nav class="navbar navbar-expand-lg navbar-light p-0">
                  <div class="iq-navbar-logo d-flex align-items-center justify-content-between">
                      <i class="ri-menu-line wrapper-menu"></i>
                      <a href="index.jsp" class="header-logo">
                          <img src="/boot/llr/images/logo.png" class="img-fluid rounded-normal" alt="logo">
                          <h5 class="logo-title ml-3">首页</h5>
      
                      </a>
                  </div>
                  <div class="iq-search-bar device-search">
                      <form action="#" class="searchbox">
                          <a class="search-link" href="#"><i class="ri-search-line"></i></a>
                          <input type="text" class="text search-input" placeholder="Search here...">
                      </form>
                  </div>
                  <div class="d-flex align-items-center">

                      <button class="navbar-toggler" type="button" data-toggle="collapse"
                          data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent"
                          aria-label="Toggle navigation">
                          <i class="ri-menu-3-line"></i>
                      </button>
                      <div class="collapse navbar-collapse" id="navbarSupportedContent">
                          <ul class="navbar-nav ml-auto navbar-list align-items-center">
                              <li class="nav-item nav-icon dropdown">
                                  <a href="#" class="search-toggle dropdown-toggle btn border add-btn"
                                      id="dropdownMenuButton02" data-toggle="dropdown" aria-haspopup="true"
                                      aria-expanded="false">
                                      <img src="/boot/llr/images/small/flag-01.png" alt="img-flag"
                                          class="img-fluid image-flag mr-2">En
                                  </a>
                                  <div class="iq-sub-dropdown dropdown-menu" aria-labelledby="dropdownMenuButton2">
                                      <div class="card shadow-none m-0">
                                          <div class="card-body p-3">
                                              <a class="iq-sub-card" href="#"><img
                                                      src="/boot/llr/images/small/flag-02.png" alt="img-flag"
                                                      class="img-fluid mr-2">French</a>
                                              <a class="iq-sub-card" href="#"><img
                                                      src="/boot/llr/images/small/flag-03.png" alt="img-flag"
                                                      class="img-fluid mr-2">Spanish</a>
                                              <a class="iq-sub-card" href="#"><img
                                                      src="/boot/llr/images/small/flag-04.png" alt="img-flag"
                                                      class="img-fluid mr-2">Italian</a>
                                              <a class="iq-sub-card" href="#"><img
                                                      src="/boot/llr/images/small/flag-05.png" alt="img-flag"
                                                      class="img-fluid mr-2">German</a>
                                              <a class="iq-sub-card" href="#"><img
                                                      src="/boot/llr/images/small/flag-06.png" alt="img-flag"
                                                      class="img-fluid mr-2">Japanese</a>
                                          </div>
                                      </div>
                                  </div>
                              </li>
                              <li>
                                  <a href="#" class="btn border add-btn shadow-none mx-2 d-none d-md-block"
                                      data-toggle="modal" data-target="#new-order"><i class="las la-plus mr-2"></i>New
                                      Order</a>
                              </li>
                              <li class="nav-item nav-icon search-content">
                                  <a href="#" class="search-toggle rounded" id="dropdownSearch" data-toggle="dropdown"
                                      aria-haspopup="true" aria-expanded="false">
                                      <i class="ri-search-line"></i>
                                  </a>
                                  <div class="iq-search-bar iq-sub-dropdown dropdown-menu" aria-labelledby="dropdownSearch">
                                      <form action="#" class="searchbox p-2">
                                          <div class="form-group mb-0 position-relative">
                                              <input type="text" class="text search-input font-size-12"
                                                  placeholder="type here to search...">
                                              <a href="#" class="search-link"><i class="las la-search"></i></a>
                                          </div>
                                      </form>
                                  </div>
                              </li>
                              <li class="nav-item nav-icon dropdown">
                                  <a href="#" class="search-toggle dropdown-toggle" id="dropdownMenuButton2"
                                      data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                      <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"
                                          fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
                                          stroke-linejoin="round" class="feather feather-mail">
                                          <path
                                              d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z">
                                          </path>
                                          <polyline points="22,6 12,13 2,6"></polyline>
                                      </svg>
                                      <span class="bg-primary"></span>
                                  </a>
                                  <div class="iq-sub-dropdown dropdown-menu" aria-labelledby="dropdownMenuButton2">
                                      <div class="card shadow-none m-0">
                                          <div class="card-body p-0 ">
                                              <div class="cust-title p-3">
                                                  <div class="d-flex align-items-center justify-content-between">
                                                      <h5 class="mb-0">All Messages</h5>
                                                      <a class="badge badge-primary badge-card" href="#">3</a>
                                                  </div>
                                              </div>
                                              <div class="px-3 pt-0 pb-0 sub-card">
                                                  <a href="#" class="iq-sub-card">
                                                      <div class="media align-items-center cust-card py-3 border-bottom">
                                                          <div class="">
                                                              <img class="avatar-50 rounded-small"
                                                                  src="/boot/llr/images/user/01.jpg" alt="01">
                                                          </div>
                                                          <div class="media-body ml-3">
                                                              <div class="d-flex align-items-center justify-content-between">
                                                                  <h6 class="mb-0">Emma Watson</h6>
                                                                  <small class="text-dark"><b>12 : 47 pm</b></small>
                                                              </div>
                                                              <small class="mb-0">Lorem ipsum dolor sit amet</small>
                                                          </div>
                                                      </div>
                                                  </a>
                                                  <a href="#" class="iq-sub-card">
                                                      <div class="media align-items-center cust-card py-3 border-bottom">
                                                          <div class="">
                                                              <img class="avatar-50 rounded-small"
                                                                  src="/boot/llr/images/user/02.jpg" alt="02">
                                                          </div>
                                                          <div class="media-body ml-3">
                                                              <div class="d-flex align-items-center justify-content-between">
                                                                  <h6 class="mb-0">Ashlynn Franci</h6>
                                                                  <small class="text-dark"><b>11 : 30 pm</b></small>
                                                              </div>
                                                              <small class="mb-0">Lorem ipsum dolor sit amet</small>
                                                          </div>
                                                      </div>
                                                  </a>
                                                  <a href="#" class="iq-sub-card">
                                                      <div class="media align-items-center cust-card py-3">
                                                          <div class="">
                                                              <img class="avatar-50 rounded-small"
                                                                  src="/boot/llr/images/user/03.jpg" alt="03">
                                                          </div>
                                                          <div class="media-body ml-3">
                                                              <div class="d-flex align-items-center justify-content-between">
                                                                  <h6 class="mb-0">Kianna Carder</h6>
                                                                  <small class="text-dark"><b>11 : 21 pm</b></small>
                                                              </div>
                                                              <small class="mb-0">Lorem ipsum dolor sit amet</small>
                                                          </div>
                                                      </div>
                                                  </a>
                                              </div>
                                              <a class="right-ic btn btn-primary btn-block position-relative p-2" href="#"
                                                  role="button">
                                                  View All
                                              </a>
                                          </div>
                                      </div>
                                  </div>
                              </li>
                              <li class="nav-item nav-icon dropdown">
                                  <a href="#" class="search-toggle dropdown-toggle" id="dropdownMenuButton"
                                      data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                      <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"
                                          fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
                                          stroke-linejoin="round" class="feather feather-bell">
                                          <path d="M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"></path>
                                          <path d="M13.73 21a2 2 0 0 1-3.46 0"></path>
                                      </svg>
                                      <span class="bg-primary "></span>
                                  </a>
                                  <div class="iq-sub-dropdown dropdown-menu" aria-labelledby="dropdownMenuButton">
                                      <div class="card shadow-none m-0">
                                          <div class="card-body p-0 ">
                                              <div class="cust-title p-3">
                                                  <div class="d-flex align-items-center justify-content-between">
                                                      <h5 class="mb-0">Notifications</h5>
                                                      <a class="badge badge-primary badge-card" href="#">3</a>
                                                  </div>
                                              </div>
                                              <div class="px-3 pt-0 pb-0 sub-card">
                                                  <a href="#" class="iq-sub-card">
                                                      <div class="media align-items-center cust-card py-3 border-bottom">
                                                          <div class="">
                                                              <img class="avatar-50 rounded-small"
                                                                  src="/boot/llr/images/user/01.jpg" alt="01">
                                                          </div>
                                                          <div class="media-body ml-3">
                                                              <div class="d-flex align-items-center justify-content-between">
                                                                  <h6 class="mb-0">Emma Watson</h6>
                                                                  <small class="text-dark"><b>12 : 47 pm</b></small>
                                                              </div>
                                                              <small class="mb-0">Lorem ipsum dolor sit amet</small>
                                                          </div>
                                                      </div>
                                                  </a>
                                                  <a href="#" class="iq-sub-card">
                                                      <div class="media align-items-center cust-card py-3 border-bottom">
                                                          <div class="">
                                                              <img class="avatar-50 rounded-small"
                                                                  src="/boot/llr/images/user/02.jpg" alt="02">
                                                          </div>
                                                          <div class="media-body ml-3">
                                                              <div class="d-flex align-items-center justify-content-between">
                                                                  <h6 class="mb-0">Ashlynn Franci</h6>
                                                                  <small class="text-dark"><b>11 : 30 pm</b></small>
                                                              </div>
                                                              <small class="mb-0">Lorem ipsum dolor sit amet</small>
                                                          </div>
                                                      </div>
                                                  </a>
                                                  <a href="#" class="iq-sub-card">
                                                      <div class="media align-items-center cust-card py-3">
                                                          <div class="">
                                                              <img class="avatar-50 rounded-small"
                                                                  src="/boot/llr/images/user/03.jpg" alt="03">
                                                          </div>
                                                          <div class="media-body ml-3">
                                                              <div class="d-flex align-items-center justify-content-between">
                                                                  <h6 class="mb-0">Kianna Carder</h6>
                                                                  <small class="text-dark"><b>11 : 21 pm</b></small>
                                                              </div>
                                                              <small class="mb-0">Lorem ipsum dolor sit amet</small>
                                                          </div>
                                                      </div>
                                                  </a>
                                              </div>
                                              <a class="right-ic btn btn-primary btn-block position-relative p-2" href="#"
                                                  role="button">
                                                  View All
                                              </a>
                                          </div>
                                      </div>
                                  </div>
                              </li>
                              <li class="nav-item nav-icon dropdown caption-content">
                                  <a href="#" class="search-toggle dropdown-toggle" id="dropdownMenuButton4"
                                      data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                      <img src="/boot/llr/images/user/1.png" class="img-fluid rounded" alt="user">
                                  </a>
                                  <div class="iq-sub-dropdown dropdown-menu" aria-labelledby="dropdownMenuButton">
                                      <div class="card shadow-none m-0">
                                          <div class="card-body p-0 text-center">
                                              <div class="media-body profile-detail text-center">
                                                  <img src="/boot/llr/images/page-img/profile-bg.jpg" alt="profile-bg"
                                                      class="rounded-top img-fluid mb-4">
                                                  <img src="/boot/llr/images/user/1.png" alt="profile-img"
                                                      class="rounded profile-img img-fluid avatar-70">
                                              </div>
                                              <div class="p-3">
                                                  <h5 class="mb-1"><a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d19bbeb0bf95a4be91a1a3bea1b4a3a5a8ffb2bebc">[email&#160;protected]</a></h5>
                                                  <p class="mb-0">Since 10 march, 2020</p>
                                                  <div class="d-flex align-items-center justify-content-center mt-3">
                                                      <a href="../app/user-profile.html" class="btn border mr-2">Profile</a>
                                                      <a href="auth-sign-in.jsp" class="btn border">Sign Out</a>
                                                  </div>
                                              </div>
                                          </div>
                                      </div>
                                  </div>
                              </li>
                          </ul>
                      </div>
                  </div>
              </nav>
          </div>
      </div>
      <div class="modal fade" id="new-order" tabindex="-1" role="dialog" aria-hidden="true">
          <div class="modal-dialog modal-dialog-centered" role="document">
              <div class="modal-content">
                  <div class="modal-body">
                      <div class="popup text-left">
                          <h4 class="mb-3">New Order</h4>
                          <div class="content create-workform bg-body">
                              <div class="pb-3">
                                  <label class="mb-2">Email</label>
                                  <input type="text" class="form-control" placeholder="Enter Name or Email">
                              </div>
                              <div class="col-lg-12 mt-4">
                                  <div class="d-flex flex-wrap align-items-ceter justify-content-center">
                                      <div class="btn btn-primary mr-4" data-dismiss="modal">Cancel</div>
                                      <div class="btn btn-outline-primary" data-dismiss="modal">Create</div>
                                  </div>
                              </div>
                          </div>
                      </div>
                  </div>
              </div>
          </div>
      </div>      <div class="content-page">
     <div class="container-fluid add-form-list">
        <div class="row">
            <div class="col-sm-12">
                <div class="card">
                    <div class="card-header d-flex justify-content-between">
                        <div class="header-title">
                            <h4 class="card-title">新增车辆</h4>
                        </div>
                    </div>
                    <div class="card-body">
                        <form   enctype="multipart/form-data" id="salesForm">
                            <div class="row">
                                <div class="col-md-12">
                                    <div class="form-group">
                                        <label>车辆品牌 *</label>
                                        <select name="brId" id="carBrands" style="width: 30%;border-radius: 10px;border: solid 1px #DCDFE8;height: 45px">
                                            <option value="-1">车辆品牌</option>
                                            <c:forEach items="${brandsList}" var="t">
                                                <option value="${t.id}"  name="brands">${t.brName}</option>
                                            </c:forEach>
                                        </select

                                    </div> 
                                </div>  
                                <div class="col-md-6">                      
                                    <div class="form-group">
                                        <label>车系 *</label>
                                        <select name="stId" id="carstyle" style="width: 30%;border-radius: 10px;border: solid 1px #DCDFE8;height: 45px">
                                            <option value="-1">车系名称</option>
                                            <c:forEach items="${styleList}" var="s">
<%--                                            <c:forEach items="${brandsList}" var="x">--%>

<%--                                                <c:if test="${s.brId==x.id}">--%>
                                                <option value="${s.id}">${s.stName}</option>
<%--                                                </c:if>--%>
<%--                                                      </c:forEach>--%>
                                            </c:forEach>

                                        </select>
<%--                                        <input type="text" class="form-control" placeholder="Enter Name" data-errors="Please Enter Name." required>--%>
                                        <div class="help-block with-errors"></div>
                                    </div>
                                </div>    
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label>价钱 *</label>
                                        <input id="price" name="cPrice" style="width: 30%;border-radius: 10px;border: solid 1px #DCDFE8;height: 45px">
<%--                                        <input type="text" class="form-control" placeholder="Enter Code" data-errors="Please Enter Code." required>--%>
                                        <div class="help-block with-errors"></div>
                                    </div>
                                </div> 
                                <div class="col-md-6"> 
                                    <div class="form-group">
                                        <label>座位数 *</label>
                                        <select name="cSeat" id="seatnum" style="width: 30%;border-radius: 10px;border: solid 1px #DCDFE8;height: 45px">
                                            <option value="2">2</option>
                                            <option value="4">4</option>
                                            <option value="6">6</option>
                                            <option value="8">8</option>
                                        </select>
                                    </div>
                                </div> 
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label>里程数 *</label>
                                        <input id="mile" name="cMileage" style="width: 30%;border-radius: 10px;border: solid 1px #DCDFE8;height: 45px">
                                    </div>
                                </div>
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label>变速箱 *</label>
                                        <select name="cCus" id="speed" style="width: 30%;border-radius: 10px;border: solid 1px #DCDFE8;height: 45px">
                                            <option>自动档</option>
                                            <option>手动档</option>
                                            <option>手自一体</option>
                                            <option>不限</option>
                                        </select>
                                    </div>
                                </div>

                                <div class="col-md-12">
                                    <div class="form-group">
                                        <label>保险日期 *</label>
                                        <input type="cInsure" id="time" style="width: 30%;border-radius: 10px;border: solid 1px #DCDFE8;height: 45px"   />
                                    </div>
                                </div>
                                <div class="col-md-12">                                    
                                    <div class="form-group">
                                        <label>上牌日期 *</label>
                                        <input type="cRegistration" id="startime" style="width: 30%;border-radius: 10px;border: solid 1px #DCDFE8;height: 45px" />
                                        <div class="help-block with-errors"></div>
                                    </div>
                                </div>
                                <div class="col-md-12">
                                    <div class="form-group">
                                        <label>图片 *</label>

<%--                                        <jsp:include page="accompanyapply2_upload.jsp" flush="true"></jsp:include>--%>


<%--&lt;%&ndash;                                        <%@ include file="/WEB-INF/jsp/backend/accompanyapply2_upload.jsp"%>&ndash;%&gt;--%>
<%--                                        <form action="/boot/user/addCar" method="post" enctype="multipart/form-data">--%>
                                            <input type="file" name="file" id="carPicture">
<%--                                        </form>--%>

                                        <hr>
<%--                                        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">--%>
<%--                                            <legend>拖拽上传 </legend>--%>
<%--                                        </fieldset>--%>

<%--                                        <div class="layui-upload-drag" id="test10">--%>
<%--                                            <i class="layui-icon"></i>--%>
<%--                                            <p>点击上传，或将文件拖拽到此处</p>--%>
<%--                                            <div class="layui-progress" lay-filter="demo">--%>
<%--                                                <div class="layui-progress-bar" lay-percent="0%"></div>--%>
<%--                                            </div>--%>
<%--                                            <div class="layui-hide" id="uploadDemoView">--%>
<%--                                                <hr>--%>
<%--                                                <img src="" alt="上传成功后渲染" style="max-width: 196px">--%>
<%--                                            </div>--%>
<%--                                        </div>--%>

                                    </div>
                                </div>
                                <div class="col-md-12">
                                    <div class="form-group">
                                        <label>车辆详情</label>
                                        <textarea id="descript" class="form-control" name="cDesc" rows="4"></textarea>
                                    </div>
                                </div>
                            </div>                            
                            <button type="button" onclick="Good()" class="btn btn-primary mr-2">添加</button>
                            <button type="reset" class="btn btn-danger">返回</button>
                        </form>
                    </div>
                </div>
            </div>
        </div>
        <!-- Page end  -->
    </div>
      </div>
    </div>
    <!-- Wrapper End-->
    <footer class="iq-footer">
            <div class="container-fluid">
            <div class="card">
                <div class="card-body">
                    <div class="row">
                        <div class="col-lg-6">
                            <ul class="list-inline mb-0">
                                <li class="list-inline-item"><a href="../backend/privacy-policy.html">隐私政策</a></li>
                                <li class="list-inline-item"><a href="../backend/terms-of-service.html">使用条款</a></li>
                            </ul>
                        </div>
                        <div class="col-lg-6 text-right">
                            <span class="mr-1"><script>document.write(new Date().getFullYear())</script>©</span> <a href="#" class="">首页</a>.
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </footer>

    <script language="javascript" type="text/javascript" src="/boot/llr/js/My97DatePicker/WdatePicker.js"> </script>

    <script src="/boot/llr/js/backend-bundle.min.js"></script>.

    <script src="/boot/llr/js/table-treeview.js"></script>

    <script src="/boot/llr/js/customizer.js"></script>

    <script async src="/boot/llr/js/chart-custom.js"></script>

    <script src="/boot/llr/js/app.js"></script>

    <script src="/boot/llr/layui-v2.6.5/layui/layui.js"></script>
    <script src="/boot/llr/js/jquery/jquery.min.js"></script>

    <script>

      function type() {

             // let x = document.getElementsByName("brands").value;
             alert(11111);

      }


      function Good(){
  //         let picture = document.getElementById("picture")
  //         let picture1=picture.innerHTML
  // alert(picture1)
  //         let carBrands=$("#carBrands").val();
  //         let carstyle=$("#carstyle").val();
  //         let price=$("#price").val();
  //         let seatnum=$("#seatnum").val();
  //         let mile=$("#mile").val();
  //         let speed=$("#speed").val();
  //         let time=$("#time").val();3
  //         let startime=$("#startime").val();
  //         let carPicture=picture1;
  //         let descript=$("#descript").val();
  //         window.location="/boot/user/addCar?carBrands="+carBrands+"&carstyle="+carstyle+"&price="+price+"&seatnum="+seatnum
  //             +"&mile="+mile+"&speed="+speed+"&time="+time+"&startime="+startime+"&carPicture="+carPicture+"&descript="+descript;
          let formData = new FormData($("#salesForm")[0]);
          $.ajax({
              url: "/boot/user/addCar",        //后台url
              data: formData,
              cache: false,
              async: false,
              type: "POST",                   //类型，POST或者GET
              dataType: 'json',              //数据返回类型，可以是xml、json等
              processData: false,
              contentType: false,
              success: function (data) {      //成功，回调函数
                 alert(data.msg)
              },
          });
      }

      //图片上传
      // layui.use(['upload','element','layer'],function () {
      //     var $=layui.jquery
      //     ,upload=layui.upload
      //     ,element=layui.element
      //     ,layer=layui.layer;
      //     //拖拽上传
      //     upload.render({
      //         elem:'#test10'
      //         ,url:"http://localhost:8089/boot/user/addCar"
      //         ,progress:function (n,elem,res,index) {
      //           var percent=n+'%' //获取进度百分比
      //             element.progress('demo',percent);
      //           element.progress('demo-'+index,n+'%') //进度条
      //         }
      //         ,done:function (res) {
      //             layer.msg('上传成功');
      //             layui.$('#uploadDemoView').removeClass('layui-hide').find('img').attr('src', "http://localhost/boot/imgs/"+res.data);
      //             console.log(res)
      //
      //         }
      //     });
      //
      // });

  </script>
  </body>
</html>